package ensemble.samples.controls

import ensemble.DynamicSizeSample
import javafx.collections.FXCollections
import javafx.geometry.Pos
import collection.JavaConverters._

class ComboBoxSampleS extends DynamicSizeSample {
  import net.oschina.oldpig.snout.FxBuilder._

  private final val strings = FXCollections.observableArrayList(
    "Option 1", "Option 2", "Option 3",
    "Option 4", "Option 5", "Option 6",
    "Longer ComboBox item",
    "Option 7", "Option 8", "Option 9",
    "Option 10", "Option 12")

  def content =
    hBox(alignment:=Pos.CENTER, spacing:=15){
      comboBox[String](id := "uneditable-combobox", promptText := "Make a choice...", items := FXCollections.observableArrayList(strings.subList(0, 8)).asScala)
      comboBox[String](id := "editable-combobox", promptText := "Edit or Choose...", items := strings.asScala, editable := true)
    }

}
